<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
       
 <% String  now= request.getContextPath();
	String path= request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+now +"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta charset="utf-8">
	<title>人事申请</title>
	<link rel="stylesheet" type="text/css" href="<%=path%>/myoa/layui/css/layui.css" media="all">
  <script type="text/javascript"  src="<%=path%>/myoa/js/jquery-3.2.1.js"></script>
   <script src="<%=path%>/myoa/layui/lay/modules/laydate.js"></script> 
	<script type="text/javascript" src="<%=path%>/myoa/layui/layui.js" ></script>
  <script src="<%=path%>/myoa/laydate/laydate.js"></script>
	
 
  <style type="text/css">
body{
  width:800px;
  margin:0px auto;
/*   margin-top:50px; */
}

#text{
  margin-left:80px;
}
#plane{
width:650px;
height:200px;
margin-left: 0px; 

}
</style>

<script>
//执行一个laydate实例
laydate.render({
  elem: '#date'
  ,type: 'datetime'
});

//layui的from表单函数  
layui.use('form', function(){
  var form = layui.form;
  
  //监听提交
  form.on('submit(formDemo)', function(data){
    layer.msg(JSON.stringify(data.field));
    return false;
  });

  form.on('select(day)', function(data){
    console.log(data.value);
if (data.value=="其他") {

  $("#days").attr('class', 'layui-show');
}
  
});  


});

</script>


</head>
<body>

<div>
<h1  style="text-align: center ;">人事申请</h1>
<hr>

</div>

<form class="layui-form" action="/OA/insertPersonApply" method="post">
  <div class="layui-form-item">
    <label class="layui-form-label">申请人姓名</label>
    <div class="layui-input-block">
      <input type="text" name="pa_name" lay-verify="title" autocomplete="off"  readonly value="${sessionScope.name}" class="layui-input"    style="width:250px" >
  </div>
  </div>


  <div class="layui-form-item">
    <label class="layui-form-label">联系电话</label>
    <div class="layui-input-inline">
      <input type="text" name="pa_phone" required lay-verify="required" placeholder="请输入联系电话(必填)" autocomplete="off" class="layui-input" style="width:250px">
    </div>
</div>

 <div class="layui-form-item">
    <label class="layui-form-label">所属部门</label>
    <div class="layui-input-block">
      <input type="text" name="pa_dept"  autocomplete="off"  class="layui-input"  readonly value="${requestScope.pa_dept}"   style="width:250px" >
  </div>
  </div>

  <div class="layui-form-item" >
   <label class="layui-form-label">申请原因</label>
   <div class="layui-input-block">
    <input type="radio" name="pa_title" value="事假" title="事假">
    <input type="radio" name="pa_title" value="病假" title="病假" checked>
    <input type="radio" name="pa_title" value="出差" title="出差">
    <input type="radio" name="pa_title" value="其他" title="其他">
   </div>
 </div>

<!--  隐藏标签当选其他时显示 -->
<div >
  <div class="layui-form-item">
    <label class="layui-form-label">开始日期</label>
    <div class="layui-input-block">
      <input type="text" name="pa_startDate"  lay-verify="title" autocomplete="off" placeholder="请选择开始时间" class="layui-input"  style="width:250px" id="date" >
  </div>
  </div>
</div>

  <div class="layui-form-item">
    <label class="layui-form-label">申请天数</label>

    <div class="layui-input-block" style="width:250px">
      <select name="pa_day" lay-verify="required"   lay-filter="day" id="day22">
        <option value=""></option>
        <option value="1天">1天</option>
        <option value="3天">3天</option>
        <option value="其他">其他</option>
      </select>
    </div>
</div>

<!--  隐藏标签当选其他时显示 -->
<div  id="days"  class="layui-hide">
  <div class="layui-form-item">
    <label class="layui-form-label">自定义天数</label>
    <div class="layui-input-block">
      <input type="text" name="days"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input"  style="width:250px" >
  </div>
  </div>
</div>




  <div class="layui-form-item">
    <label class="layui-form-label">负责人</label>
    <div class="layui-input-block">
      <input type="text" name="pa_boss"  autocomplete="off"  class="layui-input"  readonly value="${requestScope.pa_boss}"   style="width:250px" >
  </div>
  </div>
 

 

  <div class="layui-form-item layui-form-text"      >
    <label class="layui-form-label">请假原因:</label>
    <div class="layui-input-block">
      <textarea name="pa_context" placeholder="请详细描述申请原因" class="layui-textarea" style="width:500px;height:300px"></textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
    <input type="submit" class="layui-btn" value="立即提交"></input>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>

</form>




</body>
</html>